<template>
	<view>
		<orderCommon 
			:text="text" :order="order" :afterSalesRecord="afterSalesRecord"
			:customStyle1="customStyle1" :customStyle11="customStyle11" 
			:customStyle2="customStyle2" :customStyle3="customStyle3">
		</orderCommon>
			
		<view style="margin-top: 10rpx;padding-bottom: 20rpx;width: 94%;margin-left: 3%;">
			<u-button  style="float: right;margin-right: 5rpx;" :custom-style="customStyle3" hover-class="none" :disabled="subDisabled" type="primary"
				>
				{{ $t('等待对方处理') }}
			</u-button>
			
			<u-button  @click="edit()" style="float: right;margin-right: 15rpx;" :custom-style="customStyle1" hover-class="none" :disabled="subDisabled" type="primary"
				>
				{{ $t('修改售后申请') }}
			</u-button>
			
			
			<u-button @click="chexiao()"  style="float: right;margin-right: 15rpx;" :custom-style="customStyle1" hover-class="none" :disabled="subDisabled" type="primary"
				>
				{{ $t('撤销申请') }}
			</u-button>	
			<view style="clear: both;"></view>
		</view>
			
		<view style="height: 50px;"></view>
		
	</view>
</template>

<script>
	import orderCommon from './orderCommon.vue';
	
	export default {
		components:{
			orderCommon
		},
		props:{
			order:{
				type:Object,
				default:{}
			},
			afterSalesRecord:{
				type:Object,
				default:{}
			},
			text:{
				type:Object,
				default:{}
			},
			customStyle1:{
				type:Object,
				default:{}
			},
			customStyle11:{
				type:Object,
				default:{}
			},
			customStyle2:{
				type:Object,
				default:{}
			},
			customStyle3:{
				type:Object,
				default:{}
			},
		},
		data() {
			return {
				subDisabled:false
			}
		},
		mounted(){
			
		},
		methods:{
			chexiao(){
				const that = this
				that.$u.api.order.afterSalesRevoke({
					order_id: that.order.orderInfo.id,
					aftersales_id :that.order.orderInfo.aftersales_id,
					lang:that.lang
				}).then(res => {
					uni.showModal({
						content: that.$t('操作成功'),
						showCancel: false,
						confirmText: this.$t('是'),
					})
					setTimeout(function() {
						uni.navigateBack({
							delta: -1
						});
					}, 2000);
					
					return false;
				})
			},
			edit(){
				const that = this
				that.$emit('change','customer','publisherEdit',that.afterSalesRecord)
			}
		}
	}
</script>

